package com.yz.antlr.csv.impstand;

import com.yz.antlr.csv.g4.CsvBaseListener;
import com.yz.antlr.csv.g4.CsvParser;
import org.antlr.v4.runtime.TokenStreamRewriter;
import org.antlr.v4.runtime.tree.TerminalNode;

/**
 * @author yanzhao
 * @version 1.0
 * TODO
 * @date 2022/3/29 9:19
 */
public class CsvListenWalker extends CsvBaseListener {

    private TokenStreamRewriter tokenStreamRewriter;

    public CsvListenWalker(TokenStreamRewriter tokenStreamRewriter) {
        super();
        this.tokenStreamRewriter = tokenStreamRewriter;
    }

    @Override
    public void enterContext(CsvParser.ContextContext ctx) {
        System.out.println(">>>" + ctx.getText());
        CsvParser.TitleContext title = ctx.title();
        CsvParser.RowContext row = title.row();
        System.out.println(row.getText());
    }
}
